package com.hdy.javachatroomdemo.Controller;

import com.hdy.javachatroomdemo.Model.ShowMessage;
import com.hdy.javachatroomdemo.Service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/chatRoomMessage")
public class MassageController {
    @Autowired
    MessageService messageService;
    //获取会话中的历史消息
    @RequestMapping("/getMessages")
    public List<ShowMessage> getMessages(int sessionId) {
        ;
        return messageService.queryAllShowMessage(sessionId);
    }
}
